<template>
	<view class="main">
		<tou_hand1 :handtitle=name></tou_hand1>
		<view>
			<view class="show" v-show="num==1">
				<image src="https://qiniu.jxyutuo.com/yanqin/zhiyin/cz.gif"></image>
			</view>
			<view class="show" v-show="num==2">
				<image src="https://qiniu.jxyutuo.com/yanqin/zhiyin/bk.gif"></image>
			</view>
			<view class="show" v-show="num==3">
				<image src="https://qiniu.jxyutuo.com/yanqin/zhiyin/sm.gif"></image>
			</view>
			<view class="show" v-show="num==4">
				<image src="https://qiniu.jxyutuo.com/yanqin/zhiyin/yc.gif"></image>
			</view>
		</view>
		

	</view>
</template>

<script>
	import tou_hand1 from '../../components/tou_hand2/tou_hand2.vue'

	export default {
		components: {
			tou_hand1
		},
		mounted() {
			document.querySelector('body').setAttribute('style', 'background-color:#f5f5f5')
		},

		data() {
			return {
				name: '',
				num: '',
				showzhishi: false,
				index: 0,
				bklist: [
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/bk1.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/bk2.jpg'
				], //绑定电卡图片
				czlist: [
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/cz1.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/cz2.jpg'
				], //充值图片
				smlist: [
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/sm1.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/sm2.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/sm3.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/sm4.jpg'
				], //扫码上电图片
				yclist: [
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/yc1.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/yc2.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/yc3.jpg',
					'https://qiniu.jxyutuo.com/yanqin/zhiyin/yc4.jpg'
				], //扫码上电图片
			}
		},
		onLoad(options) {
			this.name = options.name
			this.num = options.num

		},
		onShow() {

		},
		methods: {
			changeSwipe(type) {
				if(this.num==1){
					if (type == 'up') {
						if (this.index == 0) {
							this.$toast.fail('这是第一页')
							return
						}
						this.index -= 1;
					} else if (type == 'down') {
						if (this.index == this.czlist.length-1) {
							this.$toast.fail('这是最后一页')
							return
						}
						this.index += 1;
					}
					this.$refs.swiper.swipeTo(this.index);
				}else if(this.num==2){
					if (type == 'up') {
						if (this.index == 0) {
							this.$toast.fail('这是第一页')
							return
						}
						this.index -= 1;
					} else if (type == 'down') {
						if (this.index == this.bklist.length-1) {
							this.$toast.fail('这是最后一页')
							return
						}
						this.index += 1;
					}
					this.$refs.swiper1.swipeTo(this.index);
				}else if(this.num==3){
					if (type == 'up') {
						if (this.index == 0) {
							this.$toast.fail('这是第一页')
							return
						}
						this.index -= 1;
					} else if (type == 'down') {
						if (this.index == this.smlist.length-1) {
							this.$toast.fail('这是最后一页')
							return
						}
						this.index += 1;
					}
					this.$refs.swiper2.swipeTo(this.index);
				}else if(this.num==4){
					if (type == 'up') {
						if (this.index == 0) {
							this.$toast.fail('这是第一页')
							return
						}
						this.index -= 1;
					} else if (type == 'down') {
						if (this.index == this.yclist.length-1) {
							this.$toast.fail('这是最后一页')
							return
						}
						this.index += 1;
					}
					this.$refs.swiper3.swipeTo(this.index);
				}
				
			},


		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 100%;
		background-color: #F5F5F5;

		.show {
			width: 562upx;
			margin: 60upx auto;
			image {
				width: 562upx;
				height: 1215upx;
				margin: 0 auto;
			}

			
		}


	}
</style>
